$(function(){
    $("aside ul li.active").click(function() {
        var nodeId = this.id;
        var subNodes = $("aside ul li[parentId="+nodeId+"]");
        if(subNodes.css("display")=="none") {
            //subNodes.css("display", "block");
            subNodes.slideDown();
        } else {
            //subNodes.css("display", "none");
            subNodes.slideUp();
        }
    });
});
/**
 *重写alert提示框
 */
window.alert = function (title, message) {
    $("#dialog .dialog-title").text(title);
    $("#dialog .dialog-message").text(message);
    $("#dialog .dialog-btns").empty();
    var sure = $('<input type="button" value="确  定" class="btn btn-primary input-sm" />');
    $("#dialog .dialog-btns").append(sure);
    sure.on("click", function () {
        $("#dialogShadow").hide();
    });
    $("#dialogShadow").show();
}
/**
 *重写选择对话框
 */
window.confirm = function (title, message, callback) {
    $("#dialog .dialog-title").text(title);
    $("#dialog .dialog-message").text(message);
    $("#dialog .dialog-btns").empty();
    var sure = $('<input type="button" value="确  定" class="btn btn-primary input-sm" />');
    var cancel = $('<input type="button" value="取  消" class="btn btn-primary input-sm" />');
    $("#dialog .dialog-btns").append(sure);
    $("#dialog .dialog-btns").append(cancel);
    sure.on("click", function () {
        $("#dialogShadow").hide();
        callback.call();
    });
    cancel.on("click", function () {
        $("#dialogShadow").hide();
    });
    $("#dialogShadow").show();

}